import Vue from 'vue'
import App from './App.vue'
import router from './router/index'
import './plugins/element.js'
import './assets/fonts/iconfont.css'
import './assets/global.css'
import axios from 'axios'
import ZkTable from 'vue-table-with-tree-grid'
//配置请求的根路径
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'
//拦截器来给请求头添加token
axios.interceptors.request.use(config => {
  console.log(config)
  config.headers.Authorization =window.sessionStorage.getItem('token');
  return config
})
/* 把axios挂载到vue的原型对象上,这样每一个组件可以用this.$http访问axios */
Vue.prototype.$http = axios

Vue.config.productionTip = false //阻止d打印显示"当前是生产模式"的消息
Vue.component('tree-table', ZkTable)
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
